home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Presentations / Presentations ’92 / PatchWorks Kit / <PatchWorks++> / Globals.cp < prev    next >
Encoding:
Text File  |  1992-04-22  |  420 b   |  33 lines  |  [TEXT/MPS ]

  1. /*
  2.     Globals.cp
  3.     
  4.     Globals module for MPW C++.
  5.  
  6.     by Patrick C. Beard.
  7.  */
  8.  
  9. #include "Storage.h"
  10. #include "VirtualWorld.h"
  11.  
  12. #ifndef __TYPES__
  13. #include <Types.h>
  14. #endif
  15.  
  16. void AllocateWorld()
  17. {
  18.     VirtualWorld* world = new VirtualWorld(false);
  19.     Store(world);
  20. }
  21.  
  22. void DestroyWorld()
  23. {
  24.     VirtualWorld* world = (VirtualWorld*)Retrieve();
  25.     delete world;
  26.     Store(nil);
  27. }
  28.  
  29. void EnterWorld()
  30. {
  31.     ((VirtualWorld*)Retrieve())->Enter();
  32. }
  33.